universal-ctags notes

2022-01-16 · 1 min read

useful regex debugger: https://regex101.com/

single line regex: --regex-<lang>=/<line-pattern>/<tag-name-pattern>/<kind>/[<flags>]

useful flags: {exclusive}: don't run any other parsers on this line if the regex matches. useful for comments.

multi-line regex: --mline-regex-<lang>=/<line-pattern>/<tag-name-pattern>/<kind>/[<mline-flags>]

useful flags: {mgroup=N}: the capture group that decides where this tag is located (where you go when you go-to the tag). necessary for pretty much every mline regex AFAICT.

useful character classes:

[[:blank:]] == [ \t]

[[:space:]] == \s == any whitespace character (incl. newline if multi-line)